package com.ruoyi.lm.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.IdWorker;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lm.mapper.LmUserpickMapper;
import com.ruoyi.lm.domain.LmUserpick;
import com.ruoyi.lm.service.ILmUserpickService;
import com.ruoyi.common.core.text.Convert;

/**
 * 用户关注列Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-09-27
 */
@Service
public class LmUserpickServiceImpl implements ILmUserpickService 
{
    @Autowired
    private LmUserpickMapper lmUserpickMapper;

    /**
     * 查询用户关注列
     * 
     * @param id 用户关注列ID
     * @return 用户关注列
     */
    @Override
    public LmUserpick selectLmUserpickById(String id)
    {
        return lmUserpickMapper.selectLmUserpickById(id);
    }

    /**
     * 查询用户关注列列表
     * 
     * @param lmUserpick 用户关注列
     * @return 用户关注列
     */
    @Override
    public List<LmUserpick> selectLmUserpickList(LmUserpick lmUserpick)
    {
        return lmUserpickMapper.selectLmUserpickList(lmUserpick);
    }

    /**
     * 新增用户关注列
     * 
     * @param lmUserpick 用户关注列
     * @return 结果
     */
    @Override
    public int insertLmUserpick(LmUserpick lmUserpick)
    {
        lmUserpick.setId(IdWorker.getId());
        lmUserpick.setCreateTime(DateUtils.getNowDate());
        return lmUserpickMapper.insertLmUserpick(lmUserpick);
    }

    /**
     * 修改用户关注列
     * 
     * @param lmUserpick 用户关注列
     * @return 结果
     */
    @Override
    public int updateLmUserpick(LmUserpick lmUserpick)
    {
        lmUserpick.setUpdateTime(DateUtils.getNowDate());
        return lmUserpickMapper.updateLmUserpick(lmUserpick);
    }

    /**
     * 删除用户关注列对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLmUserpickByIds(String ids)
    {
        return lmUserpickMapper.deleteLmUserpickByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除用户关注列信息
     * 
     * @param id 用户关注列ID
     * @return 结果
     */
    @Override
    public int deleteLmUserpickById(String id)
    {
        return lmUserpickMapper.deleteLmUserpickById(id);
    }
}
